Logs

This module provides log writing and report generation capabilities to the CCHR conversion software.

Public Classes:

Log – Class for working with log files. Report – Class for generating and updating report information.

Exceptions:

LogError – Exception raised when problem occurs in log manipulation. ReportError – Exception raised when error occurs in Report generation.

class src.log.Log(**kw)[source]

A class to support log file manipulation for CCHR data conversion software.

Public Methods: write – Writes one line of log data to a log file. load – Loads log data into an internal cardsharp dataset object. delete – Deletes the log file.

delete(fn)[source]

Deletes a log file.

Arguments: fn – name of the desired log file to delete

dump()[source]

Empties the log queue and writes to all of the log files for which there is stored log output

load(fn)[source]

Load a log file. The variables of the log file are determined by _log_types. The fn needs to have a log type indicator before the .txt in the filename (fn). Example) ancic_0.txt

@param fn: The filename of the log to load. @return: (log_data, log_type) – Returns tuple with the first value being a cardsharp dataset containing log data

and the second value is the log type.
write(fn, vals, type=0, no_add_info=False, store=False)[source]

Writes a line of log data to the log file.

@param fn: The name of log file to write (append) to. @param vals: The list of the values to write to the log file. @param type: The type of log to write. Default is 0 (see _log_types for list of avaialbe log types). @param store: Whether to store the file in memory (can be dumped to file later) or to write to file immediately

write_compare(fn, vals, type=0)[source]

Writes a line of log data to the log file.

@param fn: The name of log file to write (append) to. @param vals: The list of the values to write to the log file. @param type: The type of log to write. Default is 0 (see _log_types for list of avaialbe log types).

src.log

alias of src.log

This Page